package com.mystnihon.freeremote.util;

import java.io.Serializable;


public class Duration {

    private long mDurationInMilliseconds = 0;

    public Duration() {

    }

    public Duration(long timeInMilliseconds) {
        mDurationInMilliseconds = timeInMilliseconds;
    }

    public void setDuration(long durationInMilliseconds) {
        mDurationInMilliseconds = durationInMilliseconds;
    }
    
    public void setDuration(Duration duration){
        mDurationInMilliseconds = duration.mDurationInMilliseconds;
    }

    public int getYears() {
        return (int) (mDurationInMilliseconds / (3600 * 24 * 365 * 1000));
    }

    public int getDays() {
        return (int) (mDurationInMilliseconds / (3600 * 24 * 1000));
    }

    public int getHours() {
        return (int) (mDurationInMilliseconds / (3600 * 1000));
    }

    public int getMinutes() {
        return (int) (mDurationInMilliseconds / (60 * 1000));
    }

    public int getSeconds() {
        return (int) (mDurationInMilliseconds / (1000));
    }
    
    public String toString(){
        return "";
    }
    
    
    interface State extends Serializable{
        public void backPressed();
    }
    
    class NormalState implements State{
        /**
         * 
         */
        private static final long serialVersionUID = 1115656674846646489L;

        @Override
        public void backPressed() {
//            TorrentDetailsActivity.super.onBackPressed();
            
        }
    }
    class DisplayState implements State{
        /**
         * 
         */
        private static final long serialVersionUID = 2119011103802139633L;

        @Override
        public void backPressed() {
            //Close fragment
            
            //Set state to normal
//            mState = normalState;
        }
    }
}
